<%--
  Created by IntelliJ IDEA.
  User: leman
  Date: 2017/7/7
  Time: 12:01
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<button class="layui-btn layui-btn-small layui-btn-normal" ng-click="seaToggle()">查询账单</button>
<button class="layui-btn layui-btn-small" ng-click="active.nextPage('21', '应收新建账单', '内容17', 'newBillR')">新建账单</button>
<button class="layui-btn layui-btn-small" ng-click="active.confirmBtn('22', '应收确认账单', '内容18',confirmBillR)">确认账单</button>
<button class="layui-btn layui-btn-small" ng-click="export()">导出账单</button>
<button class="layui-btn layui-btn-small layui-btn-danger" ng-click="delBtn()">删除账单</button>

<%--<form class="layui-form" action=""  id="seaBox">--%><%-- ng-hide="mySea"--%>
<div id="seaBox" ng-hide="mySea">
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">客户</label>
            <div class="layui-input-inline">
                <select class="valName" ng-model="consignorId" ng-options="x.consignorId as x.consignorName for x in optiondata">
                    <option value="">--选择客户--</option>
                </select>
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">账单编号</label>
            <div class="layui-input-inline">
                <input type="tel" name="billCode" lay-verify="required|number" autocomplete="off" class="layui-input valName" ng-model="billCode">
            </div>
        </div>

        <div class="layui-inline">
            <label class="layui-form-label">账单状态</label>
            <div class="layui-input-inline">
                <select class="valName" ng-model="billStatus" ng-options="x.id as x.name for x in selectOptions">
                    <option value="">--选择账单状态--</option>
                </select>
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">账单日期</label>
        <div class="layui-input-inline">
            <input class="layui-input valName" placeholder="开始日期" ng-model="billDateStart" ng-click="getTime($event,'billDateStart')">
        </div>
        <div class="layui-input-inline">
            <input class="layui-input valName" placeholder="截止日期" ng-model="billDateEnd" ng-click="getTimeEnd($event,'billDateEnd')">
        </div>
    </div>
    <div class="layui-input-inline" style="text-align: center;width: 100%;">
        <button class="layui-btn layui-btn-normal" ng-click="resetBtn()">重置</button>
        <button class="layui-btn" ng-click="seaBtn()">查询</button>
    </div>
</div>
<%--</form>--%>
<div style="overflow-x:auto;">
<table class="layui-table" style="min-width: 1300px;max-width:2000px;margin-bottom: 0;">
    <tr>
        <th><input type="checkbox" ng-model="selectAll" ng-click="all(selectAll)"></th>
        <th>账单编号</th>
        <th>客户</th>
        <th>账单日期</th>
        <th>订单金额</th>
        <th>调整金额</th>
        <th>结算金额</th>
        <th>账单状态</th>
        <th>发票状态</th>
        <th>收款状态</th>
        <th>创建人</th>
        <th>创建时间</th>
    </tr>
    <tr ng-repeat="x in data.list">
        <td><input type="checkbox" ng-checked="selectAll" ng-model="person.state" ng-click="select(selected)" name="id_name" value="{{ x.id+'-'+x.billStatus}}"></td>
        <td ng-bind="x.billCode"></td>
        <td ng-bind="x.consignorName"></td>
        <td ng-bind="x.billDate.substring(0,11)"></td>
        <td ng-bind="x.orderCost"></td>
        <td ng-bind="x.alterCost"></td>
        <td ng-bind="x.settleCost"></td>
        <td ng-bind="x.billStatus=='10'?'未对账': (x.billStatus=='20'?'已确认' : ( x.billStatus=='30'?'已结账':''))"></td>
        <td ng-bind="x.invoiceStatus=='10'?'不开票': (x.invoiceStatus=='20'?'待开票' : ( x.invoiceStatus=='30'?'已开票':''))"></td>
        <td ng-bind="x.payeeStatus=='10'?'未收款': (x.payeeStatus=='20'?'部分收款' : ( x.payeeStatus=='30'?'收款完成':''))"></td>
        <td ng-bind="x.createUser"></td>
        <td ng-bind="x.gmtCreate"></td>
    </tr>
</table>
</div>
<div style="float:right;">
    <ul class="layui-box layui-laypage layui-laypage-default">
        <li>
            <a ng-class="{true:'layui-btn-disabled'}[p_current==1]" href="javascript:void(0);" ng-click="p_index(this)">首页</a>
        </li>
        <li>
            <a ng-class="{true:'layui-btn-disabled'}[p_current==1]" href="javascript:void(0);" ng-click="prev_page(this)">上一页</a>
        </li>
        <%--这块是显示多少页的--%>
        <li ng-repeat="page in pages" ng-class="{true:'active'}[p_current==page]">
            <a class="layui-laypage-curr" href="javascript:void(0);" ng-click="load_page(page)">{{ page }}</a>
        </li>
        <li>
            <a ng-class="{true:'layui-btn-disabled'}[p_current==p_all_page]" href="javascript:void(0);" ng-click="next_page(this)">下一页</a>
        </li>
        <li>
            <a ng-class="{true:'layui-btn-disabled'}[p_current==p_all_page]" href="javascript:void(0);" ng-click="p_last()">尾页</a>
        </li>
    </ul>
    <span>共{{count}}条</span>
    <span style="padding-left: 10px;">到第
        <input id="on" type="text" value="{{p_current}}"/>页
        <button class="layui-btn layui-btn-small" ng-click="goBtn()" style="margin-top: -5px;">确定</button>
    </span>
</div>




